import { useI18n } from 'vue-i18n'
interface GetLangValueInterface {
  key?: string
  type?: string
}
export function useTable(tableName: string) {
  const { t } = useI18n()
  /**
   * 获取语言文本
   */
  const getLangValue = (params: GetLangValueInterface) => {
    if (params.type === 'button') {
      return t(`${tableName}Button.${params.key}`) // carListButton.add
    } else {
      return t(`${tableName}.header.${params.key}`)
    }
  }

  return {
    getLangValue,
  }
}
